<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../build/react/umd/react.development.js"></script>
    <script src="../build/react-dom/umd/react-dom.development.js"></script>
    <script src="../build/babel/babel.min.js"></script>
</head>

<body>
    <div id="root"></div>
    <div id="root2"></div>
    <div id="root3"></div>
    <div id="root4"></div>
    <script type="text/babel">
        ReactDOM.render(<p> Hello World ! </p> ,
            document.getElementById("root"));
    </script>

    <script type="text/babel">
        ReactDOM.render(React.createElement("p",null,"Hello World2 !") ,
            document.getElementById("root2"));
    </script>
    
    <script type="text/babel">
    // jsx语法
    class HelloJSX extends React.Component {
        render() {
            return <div>Hello, { this.props.toWhat }</div>
        }
    }
    ReactDOM.render(<HelloJSX toWhat='world' />,
        document.getElementById("root3"));
    </script>

    <script type="text/babel">
    //react 原生语法
    class  HelloR  extends React.Component {
        render(){
            return React.createElement('div',null, `Hello, ${this.props.toWhat}`)
        }
    }
    ReactDOM.render(React.createElement(HelloR, { toWhat:'world' }, null),
        document.getElementById("root4"));
    </script>
</body>

</html>